#
import pymysql
import json
import os
from datetime import datetime
# from DBUtils.PooledDB import PooledDB
from dbutils.pooled_db import PooledDB
import logging
from dbs.mysql_engine import MysqlEngine

# 配置日志记录
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

class MysqlDemo(object):
    def __init__(self):
        self.name = 'apps.exp.mysql_demo.MysqlDemo'

    @staticmethod
    def add_qstn():
        qstn_title = 't1'
        notes = 'n2'
        params = (qstn_title, notes)
        sql = 'INSERT INTO z_qstn(qstn_title, notes) VALUES(%s, %s)'
        qstn_id = MysqlEngine.add_rec(sql, params)
        print(f'###### 问题编号：{qstn_id}; ???????????')

if '__main__' == __name__:
    MysqlDemo.add_qstn()